package coollemon.dataBase;

import coollemon.kernel.ContactManager;

public class DataFormat {

	/*public final int XML = 1;
	public final int VCARD = 2;
	public final int XLS = 3;
	public final int XLSX = 4;*/
	private static DataFormat df = null;
	public static DataFormat createDataFormat(int format) {
		
		switch(format){
		case 1:
			df = XML.xml;
			break;
		case 2:
			df = Vcard.vcard;
			break;
		case 3:
			df = XLS.xls;
			break;
		case 4:
			df = XLSX.xlsx;
			break;
		case 5:
			df = CSV.csv;
			break;
		default:
		
		}
		return df;
	}
	public ContactManager readFile(String filename){
		ContactManager conM = df.readFile(filename);
		return conM;
	}
	
	public boolean writeFile(ContactManager conM, String filename) {
		if(df.writeFile(conM, filename))
			return true;
		return false;
	}
	
}
